package com.yt.demo.controller;

import com.yt.demo.dto.BaseReq;
import com.yt.demo.dto.BaseResp;
import com.yt.demo.service.feign.FeignHelloService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/client")
@Slf4j
public class HelloController {
    @Autowired
    private FeignHelloService feignHelloService;

    @GetMapping("/testGet")
    public BaseResp<String> testGet(@RequestParam("param") String param) {
        return feignHelloService.testGet(param);
    }

    @PostMapping("/testPost")
    public BaseResp<String> testPost(@RequestBody BaseReq<String> req) {
        return feignHelloService.testPost(req);
    }

    @PostMapping("/testFile")
    public BaseResp<String> testFile(@RequestParam("file") MultipartFile multipartFile) {
        return feignHelloService.testFile(multipartFile);
    }
}
